package src.main.BehavioralPatterns.TemplateMethod;

import java.util.Scanner;

// 咖啡制作
public class Coffee extends BeverageTemplate{
    @Override
    protected void brew() {
        System.out.println("Coffee brew");
    }

    @Override
    protected void addCondiments() {
        System.out.println("Add milk and sugar");
    }

    @Override
    protected boolean customerWantsCondiments() {
        String answer = getUserInput();
        return answer.equals("Y");
    }

    private String getUserInput() {
        System.out.println("Do you want to add condiments to your coffee? (Y/N)");
        Scanner scanner = new Scanner(System.in);
        return scanner.nextLine();
    }
}
